package com.tom;

public class User {
	
	String name;
	String id;
	String email;
	String pass;
	
 public User(){}
 
 public User(String n, String e,String id,String p)
     {this.name = n;
      this.email = e;
      this.id = id;
      this.pass = p;
      
     }
 
 public boolean saveUser()
 {  
	 String query = "INSERT INTO USER(name, email,id, password) VALUES('" +
		 		this.name +
		 		"','" +
		 		this.email +
		 		"','" +
		 		this.id +
		 		"','" +
		 		this.pass +
		 		"')";
		 
		 
	     System.out.println(query);
		 DbManager db = new DbManager();
		 return db.insert(query);
	 }
 
public boolean update(String name,String id){
 String  q = "UPDATE USER SET name= ' " +name+ " ' WHERE id= '" +id+ "';";
 System.out.println(q);
 DbManager db = new DbManager();
  return db.update(q);
}
}
 